<template>
  <div>
    <h1>父组件</h1>
    <p>{{ msg }}</p>
    <!-- <child></child> -->
    <child :msg="msg" @click="getSonData"></child>
  </div>
</template>

<script setup>
import child from './child.vue'
import { ref } from 'vue'
const msg = ref('父组件的数据')

const getSonData = (data) => {
  console.log('子组件传递的数据：', data)
  msg.value = data
}
</script>

<style lang="scss" scoped></style>
